
// Copyright (c) Gong Chengming NARI-TECH 2010

// This file is to test some basic pthread functions.

// Created: Dec. 31, 2010 by Gong Chengming

// Reference:
// 1. http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
// 2. http://www.ibm.com/developerworks/linux/library/l-posix1.html

#include <pthread.h>
#include <stdio.h>

void* thread_fun(void* arg) {
  printf("print in thread.\n");
}

int main() {
  pthread_t thread;

  if (pthread_create(&thread, NULL, thread_fun, NULL)) {
    fprintf(stderr, "fail to create thread.\n");
    return -1;
  }

  pthread_join(thread, NULL);

  return 0;
}

